# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataMigration.V1.Model.PrimaryInstanceSettings do
  @moduledoc """
  Settings for the cluster's primary instance

  ## Attributes

  *   `databaseFlags` (*type:* `map()`, *default:* `nil`) - Database flags to pass to AlloyDB when DMS is creating the AlloyDB cluster and instances. See the AlloyDB documentation for how these can be used.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Required. The ID of the AlloyDB primary instance. The ID must satisfy the regex expression "[a-z0-9-]+".
  *   `instanceNetworkConfig` (*type:* `GoogleApi.DataMigration.V1.Model.InstanceNetworkConfig.t`, *default:* `nil`) - Optional. Metadata related to instance level network configuration.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Labels for the AlloyDB primary instance created by DMS. An object containing a list of 'key', 'value' pairs.
  *   `machineConfig` (*type:* `GoogleApi.DataMigration.V1.Model.MachineConfig.t`, *default:* `nil`) - Configuration for the machines that host the underlying database engine.
  *   `outboundPublicIpAddresses` (*type:* `list(String.t)`, *default:* `nil`) - Output only. All outbound public IP addresses configured for the instance.
  *   `privateIp` (*type:* `String.t`, *default:* `nil`) - Output only. The private IP address for the Instance. This is the connection endpoint for an end-user application.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :databaseFlags => map() | nil,
          :id => String.t() | nil,
          :instanceNetworkConfig =>
            GoogleApi.DataMigration.V1.Model.InstanceNetworkConfig.t() | nil,
          :labels => map() | nil,
          :machineConfig => GoogleApi.DataMigration.V1.Model.MachineConfig.t() | nil,
          :outboundPublicIpAddresses => list(String.t()) | nil,
          :privateIp => String.t() | nil
        }

  field(:databaseFlags, type: :map)
  field(:id)
  field(:instanceNetworkConfig, as: GoogleApi.DataMigration.V1.Model.InstanceNetworkConfig)
  field(:labels, type: :map)
  field(:machineConfig, as: GoogleApi.DataMigration.V1.Model.MachineConfig)
  field(:outboundPublicIpAddresses, type: :list)
  field(:privateIp)
end

defimpl Poison.Decoder, for: GoogleApi.DataMigration.V1.Model.PrimaryInstanceSettings do
  def decode(value, options) do
    GoogleApi.DataMigration.V1.Model.PrimaryInstanceSettings.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DataMigration.V1.Model.PrimaryInstanceSettings do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
